package com.xuan.yuapiclientsdk;


import com.xuan.yuapiclientsdk.client.YuApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(prefix = "yuapi.client")
@Data
// 当该类与SpringBoot启动类不在同一个目录下时(即@SpringBootApplication),不会被spring扫描到
@ComponentScan
public class YuapiClientConfig {
    // 从 yml配置文件中获取
    private String accessKey;
    private String secretKey;

    @Bean
    public YuApiClient yuapiClient() {
        return  new YuApiClient(accessKey, secretKey);
    }
}
